home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 August: Tool Chest / Dev.CD Aug 94.toast / Sample Code / MoreFiles 1.1.1 / MoreFilesExtras.p < prev    next >
Encoding:
Text File  |  1994-01-18  |  53.6 KB  |  1,383 lines  |  [TEXT/PJMM]

  1. UNIT MoreFilesExtras;
  2.  
  3.  
  4.  
  5. {    Apple Macintosh Developer Technical Support                                }
  6. {                                                                            }
  7. {    A collection of useful high-level File Manager routines.                }
  8. {    by Jim Luther, Apple Developer Technical Support                        }
  9. {                                                                            }
  10. {    File:        MoreFilesExtras.p                                            }
  11. {                                                                            }
  12. {    Copyright © 1992-1994 Apple Computer, Inc.                                }
  13. {    All rights reserved.                                                    }
  14. {                                                                            }
  15. {    You may incorporate this sample code into your applications without        }
  16. {    restriction, though the sample code has been provided "AS IS" and the    }
  17. {    responsibility for its operation is 100% yours.  However, what you are    }
  18. {    not permitted to do is to redistribute the source as "DSC Sample Code"    }
  19. {    after having made changes. If you're going to re-distribute the source,    }
  20. {    we require that you make it clear in the source that the code was        }
  21. {    descended from Apple Sample Code, but that you've made changes.            }
  22.  
  23.  
  24. INTERFACE
  25.  
  26. {    Deny mode permissions for use with the HOpenAware, HOpenRFAware,        }
  27. {    FSpOpenAware, and FSpOpenRFAware functions.                                }
  28.  
  29.     CONST
  30.         dmNone = $0000;
  31.         dmNoneDenyRd = $0010;
  32.         dmNoneDenyWr = $0020;
  33.         dmNoneDenyRdWr = $0030;
  34.         dmRd = $0001;            { Single writer, multiple readers; the readers }
  35.         dmRdDenyRd = $0011;
  36.         dmRdDenyWr = $0021;        { Browsing - equivalent to fsRdPerm }
  37.         dmRdDenyRdWr = $0031;
  38.         dmWr = $0002;
  39.         dmWrDenyRd = $0012;
  40.         dmWrDenyWr = $0022;
  41.         dmWrDenyRdWr = $0032;
  42.         dmRdWr = $0003;            { Shared access - equivalent to fsRdWrShPerm }
  43.         dmRdWrDenyRd = $0013;
  44.         dmRdWrDenyWr = $0023;    { Single writer, multiple readers; the writer }
  45.         dmRdWrDenyRdWr = $0033;    { Exclusive access - equivalent to fsRdWrPerm }
  46.  
  47.  
  48. {    For those times where you need to use more than one kind of                }
  49. {    File Manager parameter block but don't feel like wasting stack space,    }
  50. {    here's a parameter block you can reuse.                                    }
  51.  
  52.     TYPE
  53.         UniversalFMPBHandle = ^UniversalFMPBPtr;
  54.         UniversalFMPBPtr = ^UniversalFMPB;
  55.         UniversalFMPB = RECORD
  56.                 CASE Integer OF
  57.                     1: (
  58.                             PB: ParamBlockRec
  59.                     );
  60.                     2: (
  61.                             ciPB: CInfoPBRec
  62.                     );
  63.                     3: (
  64.                             dtPB: DTPBRec
  65.                     );
  66.                     4: (
  67.                             hPB: HParamBlockRec
  68.                     );
  69.                     5: (
  70.                             cmPB: CMovePBRec
  71.                     );
  72.                     6: (
  73.                             wdPB: WDPBRec
  74.                     );
  75.                     7: (
  76.                             fcbPB: FCBPBRec
  77.                     );
  78.             END;
  79.  
  80.  
  81. {    Used by GetUGEntries to return user or group lists.                        }
  82.  
  83.         UGEntryHandle = ^UGEntryPtr;
  84.         UGEntryPtr = ^UGEntry;
  85.         UGEntry = RECORD
  86.                 objType: Integer;
  87.                 objID: LongInt;
  88.                 name: Str31;
  89.             END;
  90.  
  91.  
  92. {    I use the following record instead of the AFPVolMountInfo structure        }
  93. {    in Files.p                                                                }
  94.  
  95.         Str8 = STRING[8];
  96.         MyAFPVolMountInfoHandle = ^MyAFPVolMountInfoPtr;
  97.         MyAFPVolMountInfoPtr = ^MyAFPVolMountInfo;
  98.         MyAFPVolMountInfo = RECORD
  99.                 length: Integer;                { length of this record }
  100.                 media: VolumeType;                { type of media, always AppleShareMediaType }
  101.                 flags: Integer;                    { 0 = normal mount; set bit 0 to inhibit greeting messages }
  102.                 nbpInterval: SignedByte;        { NBP interval parameter; 7 is a good choice }
  103.                 nbpCount: SignedByte;            { NBP count parameter; 5 is a good choice }
  104.                 uamType: Integer;                { User Authentication Method }
  105.                 zoneNameOffset: Integer;        { offset from start of record to zoneName }
  106.                 serverNameOffset: Integer;        { offset from start of record to serverName }
  107.                 volNameOffset: Integer;            { offset from start of record to volName }
  108.                 userNameOffset: Integer;        { offset from start of record to userName }
  109.                 userPasswordOffset: Integer;    { offset from start of record to userPassword }
  110.                 volPasswordOffset: Integer;        { offset from start of record to volPassword }
  111.                 zoneName: Str31;                { server's AppleTalk zone name }
  112.                 serverName: Str31;                { server name }
  113.                 volName: Str27;                    { volume name }
  114.                 userName: Str31;                { user name (zero length Pascal string for guest) }
  115.                 userPassword: Str8;                { user password (zero length Pascal string if no user password) }
  116.                 volPassword: Str8;                { volume password (zero length Pascal string if no volume password) }
  117.             END;
  118.  
  119.  
  120. {***************************************************************************}
  121.  
  122. {    Functions to get information out of GetVolParmsInfoBuffer (implemented    }
  123. {    in this Unit).                                                            }
  124.  
  125.     FUNCTION isNetworkVolume (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  126.     FUNCTION hasLimitFCBs (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  127.     FUNCTION hasLocalList (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  128.     FUNCTION hasNoMiniFndr (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  129.     FUNCTION hasNoVNEdit (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  130.     FUNCTION hasNoLclSync (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  131.     FUNCTION hasTrshOffLine (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  132.     FUNCTION hasNoSwitchTo (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  133.     FUNCTION hasNoDeskItems (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  134.     FUNCTION hasNoBootBlks (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  135.     FUNCTION hasAccessCntl (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  136.     FUNCTION hasNoSysDir (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  137.     FUNCTION hasExtFSVol (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  138.     FUNCTION hasOpenDeny (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  139.     FUNCTION hasCopyFile (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  140.     FUNCTION hasMoveRename (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  141.     FUNCTION hasDesktopMgr (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  142.     FUNCTION hasShortName (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  143.     FUNCTION hasFolderLock (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  144.     FUNCTION hasPersonalAccessPrivileges (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  145.     FUNCTION hasUserGroupList (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  146.     FUNCTION hasCatSearch (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  147.     FUNCTION hasFileIDs (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  148.     FUNCTION hasBTreeMgr (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  149.     FUNCTION hasBlankAccessPrivileges (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  150.  
  151.  
  152. {***************************************************************************}
  153.  
  154.  
  155.     FUNCTION NameFileSearch (volName: StringPtr;
  156.                                     vRefNum: Integer;
  157.                                     fileName: Str255;
  158.                                     matches: FSSpecPtr;
  159.                                     reqMatchCount: LongInt;
  160.                                     VAR actMatchCount: LongInt;
  161.                                     newSearch: Boolean;
  162.                                     partial: Boolean): OSErr;
  163. {    Use NameFileSearch to search for files with a specific file name on a    }
  164. {    volume that supports PBCatSearch.                                        }
  165. {    Note: A result of catChangedErr means the catalog has changed between    }
  166. {    searches, but the search can be continued with the possiblity that you    }
  167. {    may miss some matches or get duplicate matches.  For all other results    }
  168. {    (except for noErr), the search cannot be continued.                        }
  169. {                                                                            }
  170. {    volName            input:    A pointer to the name of a mounted volume        }
  171. {                            or nil.                                            }
  172. {    vRefNum            input:    Volume specification.                            }
  173. {    fileName        input:    The name of the file to search for.                }
  174. {    matches            input:    Pointer to array of FSSpec where the match list    }
  175. {                            is returned.                                    }
  176. {    reqMatchCount    input:    Maximum number of matches to return    (the number    }
  177. {                            of elements in the matches array).                }
  178. {    actMatchCount    output: The number of matches actually returned.        }
  179. {    newSearch        input:    If true, start a new search. If false and if    }
  180. {                            vRefNum is the same as the last call to            }
  181. {                            NameFileSearch, then start searching at the        }
  182. {                            position where the last search left off.        }
  183. {    partial            input:    If the partial parameter is false, then only    }
  184. {                            files that exactly match fileName will be        }
  185. {                            found.  If the partial parameter is true, then    }
  186. {                            all file names that contain fileName will be    }
  187. {                            found.                                            }
  188.  
  189.  
  190. {***************************************************************************}
  191.  
  192.  
  193.     FUNCTION CreatorTypeFileSearch (volName: StringPtr;
  194.                                     vRefNum: Integer;
  195.                                     creator: OSType;
  196.                                     fileType: OSType;
  197.                                     matches: FSSpecPtr;
  198.                                     reqMatchCount: LongInt;
  199.                                     VAR actMatchCount: LongInt;
  200.                                     newSearch: Boolean): OSErr;
  201. {    Use CreatorTypeFileSearch to search for files with a specific creator    }
  202. {    or fileType on a volume that supports PBCatSearch.                        }
  203. {    Note: A result of catChangedErr means the catalog has changed between    }
  204. {    searches, but the search can be continued with the possiblity that you    }
  205. {    may miss some matches or get duplicate matches.  For all other results    }
  206. {    (except for noErr), the search cannot be continued.                        }
  207. {                                                                            }
  208. {    volName            input:    A pointer to the name of a mounted volume        }
  209. {                            or nil.                                            }
  210. {    vRefNum            input:    Volume specification.                            }
  211. {    creator            input:    The creator type of the file to search for.        }
  212. {                            To ignore the creator type, pass 0x00000000 in    }
  213. {                            this field.                                        }
  214. {    fileType        input:    The file type of the file to search for.        }
  215. {                            To ignore the file type, pass 0x00000000 in        }
  216. {                            this field.                                        }
  217. {    matches            input:    Pointer to array of FSSpec where the match list    }
  218. {                            is returned.                                    }
  219. {    reqMatchCount    input:    Maximum number of matches to return    (the number    }
  220. {                            of elements in the matches array).                }
  221. {    actMatchCount    output: The number of matches actually returned.        }
  222. {    newSearch        input:    If true, start a new search. If false and if    }
  223. {                            vRefNum is the same as the last call to            }
  224. {                            CreatorTypeFileSearch, then start searching at    }
  225. {                            the position where the last search left off.    }
  226.  
  227.  
  228. {***************************************************************************}
  229.  
  230.  
  231.     FUNCTION DetermineVRefNum (pathname: StringPtr;
  232.                                     vRefNum: Integer;
  233.                                     VAR realVRefNum: Integer): OSErr;
  234. {    Use DetermineVRefNum to determine the volume reference number of a        }
  235. {    volume from a pathname, a volume specification, or a combination        }
  236. {    of the two.                                                                }
  237. {    WARNING: Volume names on the Macintosh are *not* unique -- Multiple        }
  238. {    mounted volumes can have the same name. For this reason, the use of a    }
  239. {    volume name or full pathname to identify a specific volume may not        }
  240. {    produce the results you expect.  If more than one volume has the same    }
  241. {    name and a volume name or full pathname is used, the File Manager        }
  242. {    currently uses the first volume it finds with a matching name in the    }
  243. {    volume queue.                                                            }
  244. {                                                                            }
  245. {    pathName    input:    Pointer to a full pathname or nil.  If you pass in    }
  246. {                        a partial pathname, it is ignored. A full pathname    }
  247. {                        to a volume must end with a colon character (:).    }
  248. {    vRefNum        input:    Volume specification (volume reference number,        }
  249. {                        working    directory number, drive number, or 0).        }
  250. {    realVRefNum    output:    The real volume reference number.                    }
  251.  
  252.  
  253. {***************************************************************************}
  254.  
  255.  
  256.     FUNCTION UnmountAndEject (pathname: StringPtr;
  257.                                     vRefNum: Integer): OSErr;
  258. {    Use UnmountAndEject to unmount and eject a volume. The volume is        }
  259. {    ejected only if it's ejectable and not already ejected.                    }
  260. {                                                                            }
  261. {    pathName    input:    Pointer to a full pathname or nil.  If you pass in  }
  262. {                        a partial pathname, it is ignored. A full pathname    }
  263. {                        to a volume must end with a colon character (:).    }
  264. {    vRefNum        input:    Volume specification (volume reference number,        }
  265. {                        workingdirectory number, drive number, or 0).        }
  266.  
  267.  
  268. {***************************************************************************}
  269.  
  270.  
  271.     FUNCTION OnLine (volumes: FSSpecPtr;
  272.                                     reqVolCount: Integer;
  273.                                     VAR actVolCount: Integer;
  274.                                     VAR volIndex: Integer): OSErr;
  275. {    Use OnLine to return the list of volumes currently mounted.                }
  276. {                                                                            }
  277. {    volumes        input:    Pointer to array of FSSpec where the volume list    }
  278. {                        is returned.                                        }
  279. {    reqVolCount    input:    Maximum number of volumes to return    (the number of    }
  280. {                        elements in the volumes array).                        }
  281. {    actVolCount    output: The number of volumes actually returned.            }
  282. {    volIndex    input:    The current volume index position. Set to 1 to        }
  283. {                        start with the first volume.                        }
  284. {                output:    The volume index position to get the next volume.    }
  285. {                        Pass this value the next time you call OnLine to    }
  286. {                        start where you left off.                            }
  287.  
  288.  
  289. {***************************************************************************}
  290.  
  291.  
  292.     FUNCTION GetDirID (vRefNum: Integer;
  293.                                     dirID: LongInt;
  294.                                     name: StringPtr;
  295.                                     VAR theDirID: LongInt;
  296.                                     VAR isDirectory: Boolean): OSErr;
  297. {    Use GetDirID to get the directory ID number of the directory            }
  298. {    specified.  If a file is specified, then the parent                        }
  299. {    directory of the file is returned and isDirectory is false.  If            }
  300. {    a directory is specified, then that directory's ID number is            }
  301. {    returned and isDirectory is true.                                        }
  302. {    WARNING: Volume names on the Macintosh are *not* unique -- Multiple        }
  303. {    mounted volumes can have the same name. For this reason, the use of a    }
  304. {    volume name or full pathname to identify a specific volume may not        }
  305. {    produce the results you expect.  If more than one volume has the same    }
  306. {    name and a volume name or full pathname is used, the File Manager        }
  307. {    currently uses the first volume it finds with a matching name in the    }
  308. {    volume queue.                                                            }
  309. {                                                                            }
  310. {    vRefNum            input:    Volume specification.                            }
  311. {    dirID            input:    Directory ID.                                    }
  312. {    name            input:    Pointer to object name, or nil when dirID        }
  313. {                            specifies a directory that's the object.        }
  314. {    theDirID        output:    If the object is a file, then its parent        }
  315. {                            directory ID. If the object is a directory,        }
  316. {                            then its ID.                                    }
  317. {    isDirectory        output:    True if object is a directory; false if            }
  318. {                            object is a file.                                }
  319.  
  320.  
  321. {***************************************************************************}
  322.  
  323.  
  324.     FUNCTION DirIDFromFSSpec (spec: FSSpec;
  325.                                     VAR dirID: LongInt;
  326.                                     VAR isDirectory: Boolean): OSErr;
  327. {    Use DirIDFromFSSpec to get the directory ID number of the directory        }
  328. {    specified by spec. If spec is to a file, then the parent                }
  329. {    directory of the file is returned and isDirectory is false.  If            }
  330. {    spec is to a directory, then that directory's ID number is                }
  331. {    returned and isDirectory is true.                                        }
  332. {                                                                            }
  333. {    spec            input:    An FSSpec record specifying the directory.        }
  334. {    theDirID        output:    The directory ID.                                }
  335. {    isDirectory        output:    True if object is a directory; false if            }
  336. {                            object is a file.                                }
  337.  
  338.  
  339. {***************************************************************************}
  340.  
  341.  
  342.     FUNCTION GetDirName (vRefNum: Integer;
  343.                                     dirID: LongInt;
  344.                                     name: StringPtr): OSErr;
  345. {    Use GetDirName to get the name of a directory from its directory ID.    }
  346. {                                                                            }
  347. {    vRefNum        input:    Volume specification.                                }
  348. {    dirID        input:    Directory ID.                                        }
  349. {    name        output:    Points to a buffer (minimum Str63) where the        }
  350. {                        directory name is to be returned or must be nil.    }
  351.  
  352.  
  353. {***************************************************************************}
  354.  
  355.  
  356.     FUNCTION GetParentID (vRefNum: Integer;
  357.                                     dirID: LongInt;
  358.                                     name: StringPtr;
  359.                                     VAR parID: LongInt): OSErr;
  360. {    Use GetParentID to get the parent directory ID number of the specified    }
  361. {    object.                                                                    }
  362. {                                                                            }
  363. {    vRefNum        input:    Volume specification.                                }
  364. {    dirID        input:    Directory ID.                                        }
  365. {    name        input:    Pointer to object name, or nil when dirID specifies    }
  366. {                        a directory that's the object.                        }
  367. {    parID        output:    The parent directory ID of the specified object.    }
  368.  
  369.  
  370. {***************************************************************************}
  371.  
  372.  
  373.     FUNCTION GetFilenameFromPathname (pathname: Str255;
  374.                                     VAR filename: Str255): OSErr;
  375. {    Use GetFilenameFromPathname to get the file (or directory) name from    }
  376. {    the end of a full or partial pathname. Returns notAFileErr if the        }
  377. {    pathname is nil, the pathname is empty, or the pathname cannot refer to    }
  378. {    a filename (with a noErr result, the pathname could still refer to a    }
  379. {    directory). GetFilenameFromPathname is used by GetObjectLocation.        }
  380. {                                                                            }
  381. {    pathname    input:    A full or partial pathname.                            }
  382. {    filename    output:    The file (or directory) name.                        }
  383.  
  384.  
  385. {***************************************************************************}
  386.  
  387.  
  388.     FUNCTION GetObjectLocation (vRefNum: Integer;
  389.                                     dirID: LongInt;
  390.                                     pathname: StringPtr;
  391.                                     VAR realVRefNum: Integer;
  392.                                     VAR realParID: LongInt;
  393.                                     VAR realName: Str255;
  394.                                     VAR isDirectory: Boolean): OSErr;
  395. {    Use GetObjectLocation to get a file system object's location - that is,    }
  396. {    its real volume reference number, real parent directory ID, and name.    }
  397. {    While we're at it, determine if the object is a file or directory.        }
  398. {    If GetObjectLocation returns fnfErr, then the location information        }
  399. {    returned is valid, but it describes an object that doesn't exist.        }
  400. {    You can use the location information for another operation, such as        }
  401. {    creating a file or directory.                                            }
  402. {                                                                            }
  403. {    vRefNum        input:    Volume specification.                                }
  404. {    dirID        input:    Directory ID.                                        }
  405. {    pathname    input:    Pointer to object name, or nil when dirID specifies    }
  406. {                        a directory that's the object.                        }
  407. {    realVRefNum    output:    The real volume reference number.                    }
  408. {    realParID    output:    The parent directory ID of the specified object.    }
  409. {    realName    output:    The name of the specified object (the case of the    }
  410. {                        object name may not be the same as the object's        }
  411. {                        catalog entry on disk - since the Macintosh file    }
  412. {                        system is not case sensitive, it shouldn't matter).    }
  413. {    isDirectory    output:    True if object is a directory; false if object        }
  414. {                        is a file.                                            }
  415.  
  416.  
  417. {***************************************************************************}
  418.  
  419.  
  420.     FUNCTION GetDirItems (vRefNum: Integer;
  421.                                     dirID: LongInt;
  422.                                     name: StringPtr;
  423.                                     getFiles: Boolean;
  424.                                     getDirectories: Boolean;
  425.                                     items: FSSpecPtr;
  426.                                     reqItemCount: Integer;
  427.                                     VAR actItemCount: Integer;
  428.                                     VAR itemIndex: Integer): OSErr;
  429. {    Use GetDirItems to return a list of items in a directory.                }
  430. {                                                                            }
  431. {    vRefNum            input:    Volume specification.                            }
  432. {    dirID            input:    Directory ID.                                    }
  433. {    name            input:    Pointer to object name, or nil when dirID        }
  434. {                            specifies a directory that's the object.        }
  435. {    getFiles        input:    Pass true to have files added to the items list.}
  436. {    getDirectories    input:    Pass true to have directories added to the        }
  437. {                            items list.                                        }
  438. {    items            input:    Pointer to array of FSSpec where the item list    }
  439. {                            is returned.                                    }
  440. {    reqItemCount    input:    Maximum number of items to return (the number    }
  441. {                            of elements in the items array).                }
  442. {    actItemCount    output: The number of volumes actually returned.        }
  443. {    itemIndex        input:    The current item index position. Set to 1 to    }
  444. {                            start with the first item in the directory.        }
  445. {                    output:    The item index position to get the next item.    }
  446. {                            Pass this value the next time you call            }
  447. {                            GetDirItems to start where you left off.        }
  448.  
  449.  
  450. {***************************************************************************}
  451.  
  452.  
  453.     FUNCTION BumpDate (vRefNum: Integer;
  454.                                     dirID: LongInt;
  455.                                     name: StringPtr): OSErr;
  456. {    Use BumpDate to change the modification date of a file or directory to    }
  457. {    the current date/time.  If the modification date is already equal to    }
  458. {    the current date/time, then add one second to the modification date.    }
  459. {                                                                            }
  460. {    vRefNum    input:    Volume specification.                                    }
  461. {    dirID    input:    Directory ID.                                            }
  462. {    name    input:    Pointer to object name, or nil when dirID specifies        }
  463. {                    a directory that's the object.                            }
  464.  
  465.  
  466. {***************************************************************************}
  467.  
  468.     FUNCTION FSpBumpDate (spec: FSSpec): OSErr;
  469. {    Use FSpBumpDate to change the modification date of a file or directory    }
  470. {    to the current date/time.  If the modification date is already equal    }
  471. {    to the current date/time, then add one second to the modification date.    }
  472. {                                                                            }
  473. {    spec    input:    An FSSpec record specifying the object.                    }
  474.  
  475.  
  476. {***************************************************************************}
  477.  
  478.  
  479.     FUNCTION ChangeCreatorType (vRefNum: Integer;
  480.                                     dirID: LongInt;
  481.                                     name: Str255;
  482.                                     creator: OSType;
  483.                                     fileType: OSType): OSErr;
  484. {    Use ChangeCreatorType to change the creator or file type of a file.        }
  485. {                                                                            }
  486. {    vRefNum        input:    Volume specification.                                }
  487. {    dirID        input:    Directory ID.                                        }
  488. {    name        input:    The name of the file.                                }
  489. {    creator        input:    The new creator type or 0x00000000 to leave            }
  490. {                        the creator type alone.                                }
  491. {    fileType    input:    The new file type or 0x00000000 to leave the        }
  492. {                        file type alone.                                    }
  493.  
  494.  
  495. {***************************************************************************}
  496.  
  497.  
  498.     FUNCTION FSpChangeCreatorType (spec: FSSpec;
  499.                                     creator: OSType;
  500.                                     fileType: OSType): OSErr;
  501. {    Use FSpChangeCreatorType to change the creator or file type of a file.    }
  502. {                                                                            }
  503. {    spec        input:    An FSSpec record specifying the file.                }
  504. {    creator        input:    The new creator type or 0x00000000 to leave            }
  505. {                        the creator type alone.                                }
  506. {    fileType    input:    The new file type or 0x00000000 to leave the        }
  507. {                        file type alone.                                    }
  508.  
  509.  
  510. {***************************************************************************}
  511.  
  512.  
  513.     FUNCTION ChangeFDFlags (vRefNum: Integer;
  514.                                     dirID: LongInt;
  515.                                     name: StringPtr;
  516.                                     setBits: Boolean;
  517.                                     flagBits: Integer): OSErr;
  518. {    Use ChangeFDFlags to set or clear Finder Flag bits in the fdFlags field    }
  519. {    of a file or directory's FInfo record.                                    }
  520. {                                                                            }
  521. {    vRefNum        input:    Volume specification.                                }
  522. {    dirID        input:    Directory ID.                                        }
  523. {    name        input:    Pointer to object name, or nil when dirID specifies    }
  524. {                        a directory that's the object.                        }
  525. {    setBits        input:    If true, then set the bits specified in flagBits.    }
  526. {                        If false, then clear the bits specified in flagBits.}
  527. {    flagBits    input:    The flagBits parameter specifies which Finder Flag    }
  528. {                        bits to set or clear. If a bit in flagBits is set,    }
  529. {                        then the same bit in fdFlags is either set or        }
  530. {                        cleared depending on the state of the setBits        }
  531. {                        parameter.                                            }
  532.  
  533.  
  534. {***************************************************************************}
  535.  
  536.  
  537.     FUNCTION FSpChangeFDFlags (spec: FSSpec;
  538.                                     setBits: Boolean;
  539.                                     flagBits: Integer): OSErr;
  540. {    Use FSpChangeFDFlags to set or clear Finder Flag bits in the fdFlags    }
  541. {    field of a file or directory's FInfo record.                            }
  542. {                                                                            }
  543. {    spec        input:    An FSSpec record specifying the object.                }
  544. {    setBits        input:    If true, then set the bits specified in flagBits.    }
  545. {                        If false, then clear the bits specified in flagBits.}
  546. {    flagBits    input:    The flagBits parameter specifies which Finder Flag    }
  547. {                        bits to set or clear. If a bit in flagBits is set,    }
  548. {                        then the same bit in fdFlags is either set or        }
  549. {                        cleared depending on the state of the setBits        }
  550. {                        parameter.                                            }
  551.  
  552.  
  553. {***************************************************************************}
  554.  
  555.  
  556.     FUNCTION SetIsInvisible (vRefNum: Integer;
  557.                                     dirID: LongInt;
  558.                                     name: StringPtr): OSErr;
  559. {    Use SetIsInvisible to set the invisible bit in the fdFlags word of the    }
  560. {    specified file or directory's finder information.                        }
  561. {                                                                            }
  562. {    vRefNum    input:    Volume specification.                                    }
  563. {    dirID    input:    Directory ID.                                            }
  564. {    name    input:    Pointer to object name, or nil when dirID specifies        }
  565. {                    a directory that's the object.                            }
  566.  
  567.  
  568. {***************************************************************************}
  569.  
  570.  
  571.     FUNCTION FSpSetIsInvisible (spec: FSSpec): OSErr;
  572. {    Use FSpSetIsInvisible to set the invisible bit in the fdFlags word of    }
  573. {    the specified file or directory's finder information.                    }
  574. {                                                                            }
  575. {    spec    input:    An FSSpec record specifying the object.                    }
  576.  
  577.  
  578. {***************************************************************************}
  579.  
  580.  
  581.     FUNCTION ClearIsInvisible (vRefNum: Integer;
  582.                                     dirID: LongInt;
  583.                                     name: StringPtr): OSErr;
  584. {    Use ClearIsInvisible to clear the invisible bit in the fdFlags word of    }
  585. {    the specified file or directory's finder information.                    }
  586. {                                                                            }
  587. {    vRefNum    input:    Volume specification.                                    }
  588. {    dirID    input:    Directory ID.                                            }
  589. {    name    input:    Pointer to object name, or nil when dirID specifies        }
  590. {                    a directory that's the object.                            }
  591.  
  592.  
  593. {***************************************************************************}
  594.  
  595.  
  596.     FUNCTION FSpClearIsInvisible (spec: FSSpec): OSErr;
  597. {    Use FSpClearIsInvisible to clear the invisible bit in the fdFlags word    }
  598. {    of the specified file or directory's finder information.                }
  599. {                                                                            }
  600. {    spec    input:    An FSSpec record specifying the object.                    }
  601.  
  602.  
  603. {***************************************************************************}
  604.  
  605.  
  606.     FUNCTION SetNameLocked (vRefNum: Integer;
  607.                                     dirID: LongInt;
  608.                                     name: StringPtr): OSErr;
  609. {    Use SetNameLocked to set the nameLocked bit in the fdFlags word of the    }
  610. {    specified file or directory's finder information.                        }
  611. {                                                                            }
  612. {    vRefNum    input:    Volume specification.                                    }
  613. {    dirID    input:    Directory ID.                                            }
  614. {    name    input:    Pointer to object name, or nil when dirID specifies        }
  615. {                    a directory that's the object.                            }
  616.  
  617.  
  618. {***************************************************************************}
  619.  
  620.  
  621.     FUNCTION FSpSetNameLocked (spec: FSSpec): OSErr;
  622. {    Use FSpSetNameLocked to set the nameLocked bit in the fdFlags word of    }
  623. {    the specified file or directory's finder information.                    }
  624. {                                                                            }
  625. {    spec    input:    An FSSpec record specifying the object.                    }
  626.  
  627.  
  628. {***************************************************************************}
  629.  
  630.  
  631.     FUNCTION ClearNameLocked (vRefNum: Integer;
  632.                                     dirID: LongInt;
  633.                                     name: StringPtr): OSErr;
  634. {    Use ClearNameLocked to clear the nameLocked bit in the fdFlags word of    }
  635. {    the specified file or directory's finder information.                    }
  636. {                                                                            }
  637. {    vRefNum    input:    Volume specification.                                    }
  638. {    dirID    input:    Directory ID.                                            }
  639. {    name    input:    Pointer to object name, or nil when dirID specifies        }
  640. {                    a directory that's the object.                            }
  641.  
  642.  
  643. {***************************************************************************}
  644.  
  645.  
  646.     FUNCTION FSpClearNameLocked (spec: FSSpec): OSErr;
  647. {    Use FSpClearNameLocked to clear the nameLocked bit in the fdFlags word    }
  648. {    of the specified file or directory's finder information.                }
  649. {                                                                            }
  650. {    spec    input:    An FSSpec record specifying the object.                    }
  651.  
  652.  
  653. {***************************************************************************}
  654.  
  655.  
  656.     FUNCTION SetIsStationery (vRefNum: Integer;
  657.                                     dirID: LongInt;
  658.                                     name: Str255): OSErr;
  659. {    Use SetIsStationery to set the isStationery bit in the fdFlags word        }
  660. {    of the specified file or directory's finder information.                }
  661. {                                                                            }
  662. {    vRefNum    input:    Volume specification.                                    }
  663. {    dirID    input:    Directory ID.                                            }
  664. {    name    input:    Pointer to object name, or nil when dirID specifies        }
  665. {                    a directory that's the object.                            }
  666.  
  667.  
  668. {***************************************************************************}
  669.  
  670.  
  671.     FUNCTION FSpSetIsStationery (spec: FSSpec): OSErr;
  672. {    Use FSpSetIsStationery to set the isStationery bit in the fdFlags        }
  673. {    word of the specified file or directory's finder information.            }
  674. {                                                                            }
  675. {    spec    input:    An FSSpec record specifying the object.                    }
  676.  
  677.  
  678. {***************************************************************************}
  679.  
  680.  
  681.     FUNCTION ClearIsStationery (vRefNum: Integer;
  682.                                     dirID: LongInt;
  683.                                     name: Str255): OSErr;
  684. {    Use ClearIsStationery to clear the isStationery bit in the fdFlags        }
  685. {    word of the specified file or directory's finder information.            }
  686. {                                                                            }
  687. {    vRefNum    input:    Volume specification.                                    }
  688. {    dirID    input:    Directory ID.                                            }
  689. {    name    input:    Pointer to object name, or nil when dirID specifies        }
  690. {                    a directory that's the object.                            }
  691.  
  692.  
  693. {***************************************************************************}
  694.  
  695.  
  696.     FUNCTION FSpClearIsStationery (spec: FSSpec): OSErr;
  697. {    Use FSpClearIsStationery to clear the isStationery bit in the fdFlags    }
  698. {    word of the specified file or directory's finder information.            }
  699. {                                                                            }
  700. {    spec    input:    An FSSpec record specifying the object.                    }
  701.  
  702.  
  703. {***************************************************************************}
  704.  
  705.  
  706.     FUNCTION SetHasCustomIcon (vRefNum: Integer;
  707.                                     dirID: LongInt;
  708.                                     name: StringPtr): OSErr;
  709. {    Use SetHasCustomIcon to set the hasCustomIcon bit in the fdFlags word    }
  710. {    of the specified file or directory's finder information.                }
  711. {                                                                            }
  712. {    vRefNum    input:    Volume specification.                                    }
  713. {    dirID    input:    Directory ID.                                            }
  714. {    name    input:    Pointer to object name, or nil when dirID specifies        }
  715. {                    a directory that's the object.                            }
  716.  
  717.  
  718. {***************************************************************************}
  719.  
  720.  
  721.     FUNCTION FSpSetHasCustomIcon (spec: FSSpec): OSErr;
  722. {    Use FSpSetHasCustomIcon to set the hasCustomIcon bit in the fdFlags        }
  723. {    word of the specified file or directory's finder information.            }
  724. {                                                                            }
  725. {    spec    input:    An FSSpec record specifying the object.                    }
  726.  
  727.  
  728. {***************************************************************************}
  729.  
  730.  
  731.     FUNCTION ClearHasCustomIcon (vRefNum: Integer;
  732.                                     dirID: LongInt;
  733.                                     name: StringPtr): OSErr;
  734. {    Use ClearHasCustomIcon to clear the hasCustomIcon bit in the fdFlags    }
  735. {    word of the specified file or directory's finder information.            }
  736. {                                                                            }
  737. {    vRefNum    input:    Volume specification.                                    }
  738. {    dirID    input:    Directory ID.                                            }
  739. {    name    input:    Pointer to object name, or nil when dirID specifies        }
  740. {                    a directory that's the object.                            }
  741.  
  742.  
  743. {***************************************************************************}
  744.  
  745.  
  746.     FUNCTION FSpClearHasCustomIcon (spec: FSSpec): OSErr;
  747. {    Use FSpClearHasCustomIcon to clear the hasCustomIcon bit in the fdFlags    }
  748. {    word of the specified file or directory's finder information.            }
  749. {                                                                            }
  750. {    spec    input:    An FSSpec record specifying the object.                    }
  751.  
  752.  
  753. {***************************************************************************}
  754.  
  755.  
  756.     FUNCTION ClearHasBeenInited (vRefNum: Integer;
  757.                                     dirID: LongInt;
  758.                                     name: StringPtr): OSErr;
  759. {    Use ClearHasBeenInited to clear the hasBeenInited bit in the fdFlags    }
  760. {    word of the specified file or directory's finder information.            }
  761. {                                                                            }
  762. {    vRefNum    input:    Volume specification.                                    }
  763. {    dirID    input:    Directory ID.                                            }
  764. {    name    input:    Pointer to object name, or nil when dirID specifies        }
  765. {                    a directory that's the object.                            }
  766.  
  767.  
  768. {***************************************************************************}
  769.  
  770.     FUNCTION FSpClearHasBeenInited (spec: FSSpec): OSErr;
  771. {    Use FSpClearHasBeenInited to clear the hasBeenInited bit in the fdFlags    }
  772. {    word of the specified file or directory's finder information.            }
  773. {                                                                            }
  774. {    spec    input:    An FSSpec record specifying the object.                    }
  775.  
  776.  
  777. {***************************************************************************}
  778.  
  779.  
  780.     FUNCTION CopyFileMgrAttributes (srcVRefNum: Integer;
  781.                                     srcDirID: LongInt;
  782.                                     srcName: StringPtr;
  783.                                     dstVRefNum: Integer;
  784.                                     dstDirID: LongInt;
  785.                                     dstName: StringPtr;
  786.                                     copyLockBit: Boolean): OSErr;
  787. {    Use CopyFileMgrAttributes to copy all File Manager attributes from the    }
  788. {    source file or directory to the destination file or directory.            }
  789. {    If copyLockBit is true, then set the locked state of the destination    }
  790. {    to match the source.                                                    }
  791. {                                                                            }
  792. {    srcVRefNum    input:    Source volume specification.                        }
  793. {    srcDirID    input:    Source directory ID.                                }
  794. {    srcName        input:    Pointer to source object name, or nil when            }
  795. {                        srcDirID specifies a directory that's the object.    }
  796. {    dstVRefNum    input:    Destination volume specification.                    }
  797. {    dstDirID    input:    Destination directory ID.                            }
  798. {    dstName        input:    Pointer to destination object name, or nil when        }
  799. {                        dstDirID specifies a directory that's the object.    }
  800. {    copyLockBit    input:    If true, set the locked state of the destination    }
  801. {                        to match the source.                                }
  802.  
  803.  
  804. {***************************************************************************}
  805.  
  806.  
  807.     FUNCTION FSpCopyFileMgrAttributes (srcSpec: FSSpec;
  808.                                     dstSpec: FSSpec;
  809.                                     copyLockBit: Boolean): OSErr;
  810. {    Use FSpCopyFileMgrAttributes to copy all File Manager attributes from    }
  811. {    the source file or directory to the destination file or directory.        }
  812. {    If copyLockBit is true, then set the locked state of the destination    }
  813. {    to match the source.                                                    }
  814. {                                                                            }
  815. {    srcSpec        input:    An FSSpec record specifying the source object.        }
  816. {    dstSpec        input:    An FSSpec record specifying the destination object.    }
  817. {    copyLockBit    input:    If true, set the locked state of the destination    }
  818. {                        to match the source.                                }
  819.  
  820.  
  821. {***************************************************************************}
  822.  
  823.  
  824.     FUNCTION HOpenAware (vRefNum: Integer;
  825.                                     dirID: LongInt;
  826.                                     fileName: Str255;
  827.                                     denyModes: Integer;
  828.                                     VAR refNum: Integer): OSErr;
  829. {    Use HOpenAware to open the data fork of a file using deny mode            }
  830. {    permissions instead the normal File Manager permissions.  If OpenDeny    }
  831. {    is not available, then HOpenAware translates the deny modes to the        }
  832. {    closest File Manager permissions and tries to open the file with        }
  833. {    OpenDF first, and then Open if OpenDF isn't available. By using            }
  834. {    HOpenAware with deny mode permissions, a program can be "AppleShare        }
  835. {    aware" and fall back on the standard File Manager open calls            }
  836. {    automatically.                                                            }
  837. {                                                                            }
  838. {    vRefNum        input:    Volume specification.                                }
  839. {    dirID        input:    Directory ID.                                        }
  840. {    fileName    input:    The name of the file.                                }
  841. {    denyModes    input:    The deny modes access under which to open the file.    }
  842. {    refNum        output:    The file reference number of the opened file.        }
  843.  
  844.  
  845. {***************************************************************************}
  846.  
  847.  
  848.     FUNCTION FSpOpenAware (spec: FSSpec;
  849.                                     denyModes: Integer;
  850.                                     VAR refNum: Integer): OSErr;
  851. {    Use FSpOpenAware to open the data fork of a file using deny mode        }
  852. {    permissions instead the normal File Manager permissions.  If OpenDeny    }
  853. {    is not available, then FSpOpenAware translates the deny modes to the    }
  854. {    closest File Manager permissions and tries to open the file with        }
  855. {    OpenDF first, and then Open if OpenDF isn't available. By using            }
  856. {    FSpOpenAware with deny mode permissions, a program can be "AppleShare    }
  857. {    aware" and fall back on the standard File Manager open calls            }
  858. {    automatically.                                                            }
  859. {                                                                            }
  860. {    spec        input:    An FSSpec record specifying the file.                }
  861. {    denyModes    input:    The deny modes access under which to open the file.    }
  862. {    refNum        output:    The file reference number of the opened file.        }
  863.  
  864.  
  865. {***************************************************************************}
  866.  
  867.  
  868.     FUNCTION HOpenRFAware (vRefNum: Integer;
  869.                                     dirID: LongInt;
  870.                                     fileName: Str255;
  871.                                     denyModes: Integer;
  872.                                     VAR refNum: Integer): OSErr;
  873. {    Use HOpenRFAware to open the resource fork of a file using deny mode    }
  874. {    permissions instead the normal File Manager permissions.  If OpenRFDeny    }
  875. {    is not available, then HOpenRFAware translates the deny modes to the    }
  876. {    closest File Manager permissions and tries to open the file with        }
  877. {    OpenRF. By using HOpenRFAware with deny mode permissions, a program        }
  878. {    can be "AppleShare aware" and fall back on the standard File Manager    }
  879. {    open calls automatically.                                                }
  880. {                                                                            }
  881. {    vRefNum        input:    Volume specification.                                }
  882. {    dirID        input:    Directory ID.                                        }
  883. {    fileName    input:    The name of the file.                                }
  884. {    denyModes    input:    The deny modes access under which to open the file.    }
  885. {    refNum        output:    The file reference number of the opened file.        }
  886.  
  887.  
  888. {***************************************************************************}
  889.  
  890.  
  891.     FUNCTION FSpOpenRFAware (spec: FSSpec;
  892.                                     denyModes: Integer;
  893.                                     VAR refNum: Integer): OSErr;
  894. {    Use FSpOpenRFAware to open the resource fork of a file using deny mode    }
  895. {    permissions instead the normal File Manager permissions.  If OpenRFDeny    }
  896. {    is not available, then FSpOpenRFAware translates the deny modes to the    }
  897. {    closest File Manager permissions and tries to open the file with        }
  898. {    OpenRF. By using FSpOpenRFAware with deny mode permissions, a program    }
  899. {    can be "AppleShare aware" and fall back on the standard File Manager    }
  900. {    open calls automatically.                                                }
  901. {                                                                            }
  902. {    spec        input:    An FSSpec record specifying the file.                }
  903. {    denyModes    input:    The deny modes access under which to open the file.    }
  904. {    refNum        output:    The file reference number of the opened file.        }
  905.  
  906.  
  907. {***************************************************************************}
  908.  
  909.  
  910.     FUNCTION FSReadNoCache (refNum: Integer;
  911.                                     VAR count: LongInt;
  912.                                     buffPtr: Ptr): OSErr;
  913. {    Use FSReadNoCache to read any number of bytes from an open file while    }
  914. {    asking the file system to bypass its cache mechanism.                    }
  915. {                                                                            }
  916. {    refNum    input:    The file reference number of an open file.                }
  917. {    count    input:    The number of bytes to read.                            }
  918. {            output:    The number of bytes actually read.                        }
  919. {    buffPtr    input:    A pointer to the data buffer into which the bytes are    }
  920. {                    to be read.                                                }
  921.  
  922.  
  923. {***************************************************************************}
  924.  
  925.  
  926.     FUNCTION FSWriteNoCache (refNum: Integer;
  927.                                     VAR count: LongInt;
  928.                                     buffPtr: Ptr): OSErr;
  929. {    Use FSReadNoCache to write any number of bytes to an open file while    }
  930. {    asking the file system to bypass its cache mechanism.                    }
  931. {                                                                            }
  932. {    refNum    input:    The file reference number of an open file.                }
  933. {    count    input:    The number of bytes to write to the file.                }
  934. {            output:    The number of bytes actually written.                    }
  935. {    buffPtr    input:    A pointer to the data buffer from which the bytes are    }
  936. {                    to be written.                                            }
  937.  
  938.  
  939. {***************************************************************************}
  940.  
  941.  
  942.     FUNCTION CopyFork (srcRefNum: Integer;
  943.                                     dstRefNum: Integer;
  944.                                     copyBufferPtr: Ptr;
  945.                                     copyBufferSize: LongInt): OSErr;
  946. {    Use CopyFork to copy all data from the source fork to the destination    }
  947. {    fork of open file forks and makes sure the destination EOF is equal        }
  948. {    to the source EOF.                                                        }
  949. {                                                                            }
  950. {    srcRefNum        input:    The source file reference number.                }
  951. {    dstRefNum        input:    The destination file reference number.            }
  952. {    copyBufferPtr    input:    Pointer to buffer to use during copy. The        }
  953. {                            buffer should be at least 512-bytes minimum.    }
  954. {                            The larger the buffer, the faster the copy.        }
  955. {    copyBufferSize    input:    The size of the copy buffer.                    }
  956.  
  957.  
  958. {***************************************************************************}
  959.  
  960.  
  961.     FUNCTION GetFileLocation (refNum: Integer;
  962.                                     VAR vRefNum: Integer;
  963.                                     VAR dirID: LongInt;
  964.                                     fileName: StringPtr): OSErr;
  965. {    Use GetFileLocation to get the location (volume reference number,        }
  966. {    directory ID, and fileName) of an open file.                            }
  967. {                                                                            }
  968. {    refNum        input:    The file reference number of an open file.            }
  969. {    vRefNum        output:    The volume reference number.                        }
  970. {    dirID        output:    The parent directory ID.                            }
  971. {    fileName    input:    Points to a buffer (minimum Str63) where the        }
  972. {                        filename is to be returned or must be nil.            }
  973. {                output:    The filename.                                        }
  974.  
  975.  
  976. {***************************************************************************}
  977.  
  978.  
  979.     FUNCTION FSpGetFileLocation (refNum: Integer;
  980.                                     VAR spec: FSSpec): OSErr;
  981. {    Use FSpGetFileLocation to get the location of an open file in an        }
  982. {    FSSpec record.                                                            }
  983. {                                                                            }
  984. {    refNum        input:    The file reference number of an open file.            }
  985. {    spec        output:    FSSpec record containing the file name and location.}
  986.  
  987.  
  988. {***************************************************************************}
  989.  
  990.  
  991.     FUNCTION CopyDirectoryAccess (srcVRefNum: Integer;
  992.                                     srcDirID: LongInt;
  993.                                     srcName: StringPtr;
  994.                                     dstVRefNum: Integer;
  995.                                     dstDirID: LongInt;
  996.                                     dstName: StringPtr): OSErr;
  997. {    Use CopyDirectoryAccess to copy the AFP directory access privileges        }
  998. {    from one directory to another. Both directories must be on the same        }
  999. {    file server, but not necessarily on the same server volume.                }
  1000. {                                                                            }
  1001. {    srcVRefNum    input:    Source volume specification.                        }
  1002. {    srcDirID    input:    Source directory ID.                                }
  1003. {    srcName        input:    Pointer to source directory name, or nil when        }
  1004. {                        srcDirID specifies the directory.                    }
  1005. {    dstVRefNum    input:    Destination volume specification.                    }
  1006. {    dstDirID    input:    Destination directory ID.                            }
  1007. {    dstName        input:    Pointer to destination directory name, or nil when    }
  1008. {                        dstDirID specifies the directory.                    }
  1009.  
  1010.  
  1011. {***************************************************************************}
  1012.  
  1013.  
  1014.     FUNCTION FSpCopyDirectoryAccess (srcSpec: FSSpec;
  1015.                                     dstSpec: FSSpec): OSErr;
  1016. {    Use FSpCopyDirectoryAccess to copy the AFP directory access privileges    }
  1017. {    from one directory to another. Both directories must be on the same        }
  1018. {    file server, but not necessarily on the same server volume.                }
  1019. {                                                                            }
  1020. {    srcSpec        input:    An FSSpec record specifying the source directory.    }
  1021. {    dstSpec        input:    An FSSpec record specifying the destination            }
  1022. {                        directory.                                            }
  1023.  
  1024.  
  1025. {***************************************************************************}
  1026.  
  1027.  
  1028.     FUNCTION HMoveRenameCompat (vRefNum: Integer;
  1029.                                     srcDirID: LongInt;
  1030.                                     srcName: Str255;
  1031.                                     dstDirID: LongInt;
  1032.                                     dstpathName: StringPtr;
  1033.                                     copyName: StringPtr): OSErr;
  1034. {    Use HMoveRenameCompat to move a file or directory and optionally to        }
  1035. {    rename it.  The source and destination locations must be on the same    }
  1036. {    volume. This routine works even if the volume doesn't support            }
  1037. {    MoveRename.                                                                }
  1038. {                                                                            }
  1039. {    vRefNum        input:    Volume specification.                                }
  1040. {    srcDirID    input:    Source directory ID.                                }
  1041. {    srcName        input:    The source object name.                                }
  1042. {    dstDirID    input:    Destination directory ID.                            }
  1043. {    dstName        input:    Pointer to destination directory name, or            }
  1044. {                        nil when dstDirID specifies a directory.            }
  1045. {    copyName    input:    Points to the new name if the object is to be        }
  1046. {                        renamed or nil if the object isn't to be renamed.    }
  1047.  
  1048.  
  1049.  
  1050. {***************************************************************************}
  1051.  
  1052.  
  1053.     FUNCTION FSpMoveRenameCompat (srcSpec: FSSpec;
  1054.                                     dstSpec: FSSpec;
  1055.                                     copyName: StringPtr): OSErr;
  1056. {    Use FSpMoveRenameCompat to move a file or directory and optionally to    }
  1057. {    rename it. The source and destination locations must be on the same        }
  1058. {    volume. This routine works even if the volume doesn't support            }
  1059. {    MoveRename.                                                                }
  1060. {                                                                            }
  1061. {    srcSpec        input:    An FSSpec record specifying the source object.        }
  1062. {    dstSpec        input:    An FSSpec record specifying the destination            }
  1063. {                        directory.                                            }
  1064. {    copyName    input:    Points to the new name if the object is to be        }
  1065. {                        renamed or nil if the object isn't to be renamed.    }
  1066.  
  1067.  
  1068. {***************************************************************************}
  1069.  
  1070.  
  1071.     FUNCTION BuildAFPVolMountInfo (theFlags: Integer;
  1072.                                     theNBPInterval: SignedByte;
  1073.                                     theNBPCount: SignedByte;
  1074.                                     theUAMType: Integer;
  1075.                                     theZoneName: Str31;
  1076.                                     theServerName: Str31;
  1077.                                     theVolName: Str27;
  1078.                                     theUserName: Str31;
  1079.                                     theUserPassWord: Str8;
  1080.                                     theVolPassWord: Str8;
  1081.                                     theAFPInfo: MyAFPVolMountInfoPtr): OSErr;
  1082. {    Use BuildAFPVolMountInfo to initialize the fields of an AFPVolMountInfo    }
  1083. {    record before using that record to call the VolumeMount function.        }
  1084. {                                                                            }
  1085. {    theFlags        input:    The AFP mounting flags. 0 = normal mount;        }
  1086. {                            set bit 0 to inhibit greeting messages.            }
  1087. {    theNBPInterval    input:    The interval used for VolumeMount's                }
  1088. {                            NBP Lookup call. 7 is a good choice.            }
  1089. {    theNBPCount        input:    The retry count used for VolumeMount's            }
  1090. {                            NBP Lookup call. 5 is a good choice.            }
  1091. {    theUAMType        input:    The user authentication method to use.            }
  1092. {    theZoneName        input:    The AppleTalk zone name of the server.            }
  1093. {    theServerName    input:    The AFP server name.                            }
  1094. {    theVolName        input:    The AFP volume name.                            }
  1095. {    theUserName        input:    The user name (zero length Pascal string for    }
  1096. {                            guest).                                            }
  1097. {    theUserPassWord    input:    The user password (zero length Pascal string    }
  1098. {                            if no user password)                            }
  1099. {    theVolPassWord    input:    The volume password (zero length Pascal string    }
  1100. {                            if no volume password)                            }
  1101. {    theAFPInfo        input:    Pointer to AFPVolMountInfo record to            }
  1102. {                            initialize.                                        }
  1103.  
  1104.  
  1105. {***************************************************************************}
  1106.  
  1107.  
  1108.     FUNCTION RetrieveAFPVolMountInfo (theAFPInfo: AFPVolMountInfoPtr;
  1109.                                     VAR theFlags: Integer;
  1110.                                     VAR theUAMType: Integer;
  1111.                                     theZoneName: StringPtr;
  1112.                                     theServerName: StringPtr;
  1113.                                     theVolName: StringPtr;
  1114.                                     theUserName: StringPtr): OSErr;
  1115. {    Use RetrieveAFPVolMountInfo to retrieve the AFP mounting information    }
  1116. {    returned in an AFPVolMountInfo by the GetVolMountInfo function.            }
  1117. {                                                                            }
  1118. {    theAFPInfo        input:    Pointer to AFPVolMountInfo record that contains    }
  1119. {                            the AFP mounting information.                    }
  1120. {    theFlags        output:    The AFP mounting flags. 0 = normal mount;        }
  1121. {                            if bit 0 is set, greeting meesages were            }
  1122. {                            inhibited.                                        }
  1123. {    theUAMType        output:    The user authentication method used.            }
  1124. {    theZoneName        output:    The AppleTalk zone name of the server.            }
  1125. {    theServerName    output:    The AFP server name.                            }
  1126. {    theVolName        output:    The AFP volume name.                            }
  1127. {    theUserName        output:    The user name (zero length Pascal string for    }
  1128. {                            guest).                                            }
  1129.  
  1130.  
  1131. {***************************************************************************}
  1132.  
  1133.  
  1134.     FUNCTION GetUGEntries (objType: Integer;
  1135.                                     entries: UGEntryPtr;
  1136.                                     reqEntryCount: LongInt;
  1137.                                     VAR actEntryCount: LongInt;
  1138.                                     VAR objID: LongInt): OSErr;
  1139. {    Use GetUGEntries to build a list of user or group entries from the        }
  1140. {    local file server.                                                        }
  1141. {                                                                            }
  1142. {    objType            input:    The object type: -1 = group; 0 = user            }
  1143. {    UGEntries        input:    Pointer to array of UGEntry records where the    }
  1144. {                            list is returned.                                }
  1145. {    reqEntryCount    input:    The number of elements in the UGEntries array.    }
  1146. {    actEntryCount    output:    The number of entries returned.                    }
  1147. {    objID            input:    The current index position. Set to 0 to start    }
  1148. {                            with the first entry.                            }
  1149. {                    output:    The index position to get the next entry. Pass    }
  1150. {                            this value the next time you call GetUGEntries    }
  1151. {                            to start where you left off.                    }
  1152.  
  1153.  
  1154. {***************************************************************************}
  1155.  
  1156.  
  1157.     FUNCTION CopyComment (srcVRefNum: Integer;
  1158.                                     srcDirID: LongInt;
  1159.                                     srcName: StringPtr;
  1160.                                     dstVRefNum: Integer;
  1161.                                     dstDirID: LongInt;
  1162.                                     dstName: StringPtr): OSErr;
  1163. {    Use CopyComment to copy the desktop database comment from the source    }
  1164. {    to the destination object.  Both source and the destination volumes        }
  1165. {    must support the Desktop Manager.                                        }
  1166. {                                                                            }
  1167. {    srcVRefNum    input:    Source volume specification.                        }
  1168. {    srcDirID    input:    Source directory ID.                                }
  1169. {    srcName        input:    Pointer to source object name, or nil when srcDirID    }
  1170. {                        specifies a directory that's the object.            }
  1171. {    dstVRefNum    input:    Destination volume specification.                    }
  1172. {    dstDirID    input:    Destination directory ID.                            }
  1173. {    dstName        input:    Pointer to destination object name, or nil when        }
  1174. {                        dstDirID specifies a directory that's the object.    }
  1175.  
  1176.  
  1177. {***************************************************************************}
  1178.  
  1179.  
  1180.     FUNCTION FSpCopyComment (srcSpec: FSSpec;
  1181.                                     dstSpec: FSSpec): OSErr;
  1182. {    Use FSpCopyComment to copy the desktop database comment from the source    }
  1183. {    to the destination object.  Both the source and the destination volumes    }
  1184. {    must support the Desktop Manager.                                        }
  1185. {                                                                            }
  1186. {    srcSpec        input:    An FSSpec record specifying the source object.        }
  1187. {    dstSpec        input:    An FSSpec record specifying the destination object.    }
  1188.  
  1189.  
  1190. {***************************************************************************}
  1191.  
  1192.  
  1193.     FUNCTION SetComment (vRefNum: Integer;
  1194.                                     dirID: LongInt;
  1195.                                     name: StringPtr;
  1196.                                     comment: Str255): OSErr;
  1197. {    Use SetComment to set a file or directory's Finder comment field.        }
  1198. {                                                                            }
  1199. {    vRefNum    input:    Volume specification.                                    }
  1200. {    dirID    input:    Directory ID.                                            }
  1201. {    name    input:    Pointer to object name, or nil when dirID                }
  1202. {                    specifies a directory that's the object.                }
  1203. {    comment    input:    The comment to add. Comments are limited to 200            }
  1204. {                    characters; longer comments are clipped.                }
  1205.  
  1206.  
  1207. {***************************************************************************}
  1208.  
  1209.  
  1210.     FUNCTION FSpSetComment (spec: FSSpec;
  1211.                                     comment: Str255): OSErr;
  1212. {    Use FSpSetComment to set a file or directory's Finder comment field.    }
  1213. {                                                                            }
  1214. {    spec    input:    An FSSpec record specifying the file or directory.        }
  1215. {    comment    input:    The comment to add. Comments are limited to 200            }
  1216. {                    characters; longer comments are clipped.}
  1217.  
  1218.  
  1219. {***************************************************************************}
  1220.  
  1221.  
  1222.     FUNCTION GetComment (vRefNum: Integer;
  1223.                                     dirID: LongInt;
  1224.                                     name: StringPtr;
  1225.                                     comment: StringPtr): OSErr;
  1226. {    Use GetComment to get a file or directory's Finder comment field        }
  1227. {    (if any).                                                                }
  1228. {                                                                            }
  1229. {    vRefNum    input:    Volume specification.                                    }
  1230. {    dirID    input:    Directory ID.                                            }
  1231. {    name    input:    Pointer to object name, or nil when dirID                }
  1232. {                    specifies a directory that's the object.                }
  1233. {    comment    output:    Points to a buffer (minimum STRING[200]) where the        }
  1234. {                    comment is to be returned.                                }
  1235.  
  1236.  
  1237. {***************************************************************************}
  1238.  
  1239.  
  1240.     FUNCTION FSpGetComment (spec: FSSpec;
  1241.                                     comment: StringPtr): OSErr;
  1242. {    Use GetComment to get a file or directory's Finder comment field        }
  1243. {    (if any).                                                                }
  1244. {                                                                            }
  1245. {    spec    input:    An FSSpec record specifying the file or directory.        }
  1246. {    comment    output:    Points to a buffer (minimum STRING[200]) where the        }
  1247. {                    comment is to be returned.                                }
  1248.  
  1249.  
  1250. {***************************************************************************}
  1251.  
  1252.  
  1253. IMPLEMENTATION
  1254.  
  1255. {    Functions to get information out of GetVolParmsInfoBuffer.                }
  1256.  
  1257.  
  1258.     FUNCTION isNetworkVolume (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  1259.     BEGIN
  1260.         isNetworkVolume := (volParms.vMServerAdr <> 0);
  1261.     END;
  1262.  
  1263.     FUNCTION hasLimitFCBs (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  1264.     BEGIN
  1265.         hasLimitFCBs := BTST(volParms.vMAttrib, bLimitFCBs);
  1266.     END;
  1267.  
  1268.     FUNCTION hasLocalList (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  1269.     BEGIN
  1270.         hasLocalList := BTST(volParms.vMAttrib, bLocalWList);
  1271.     END;
  1272.  
  1273.     FUNCTION hasNoMiniFndr (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  1274.     BEGIN
  1275.         hasNoMiniFndr := BTST(volParms.vMAttrib, bNoMiniFndr);
  1276.     END;
  1277.  
  1278.     FUNCTION hasNoVNEdit (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  1279.     BEGIN
  1280.         hasNoVNEdit := BTST(volParms.vMAttrib, bNoVNEdit);
  1281.     END;
  1282.  
  1283.     FUNCTION hasNoLclSync (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  1284.     BEGIN
  1285.         hasNoLclSync := BTST(volParms.vMAttrib, bNoLclSync);
  1286.     END;
  1287.  
  1288.     FUNCTION hasTrshOffLine (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  1289.     BEGIN
  1290.         hasTrshOffLine := BTST(volParms.vMAttrib, bTrshOffLine);
  1291.     END;
  1292.  
  1293.     FUNCTION hasNoSwitchTo (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  1294.     BEGIN
  1295.         hasNoSwitchTo := BTST(volParms.vMAttrib, bNoSwitchTo);
  1296.     END;
  1297.  
  1298.     FUNCTION hasNoDeskItems (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  1299.     BEGIN
  1300.         hasNoDeskItems := BTST(volParms.vMAttrib, bNoDeskItems);
  1301.     END;
  1302.  
  1303.     FUNCTION hasNoBootBlks (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  1304.     BEGIN
  1305.         hasNoBootBlks := BTST(volParms.vMAttrib, bNoBootBlks);
  1306.     END;
  1307.  
  1308.     FUNCTION hasAccessCntl (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  1309.     BEGIN
  1310.         hasAccessCntl := BTST(volParms.vMAttrib, bAccessCntl);
  1311.     END;
  1312.  
  1313.     FUNCTION hasNoSysDir (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  1314.     BEGIN
  1315.         hasNoSysDir := BTST(volParms.vMAttrib, bNoSysDir);
  1316.     END;
  1317.  
  1318.     FUNCTION hasExtFSVol (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  1319.     BEGIN
  1320.         hasExtFSVol := BTST(volParms.vMAttrib, bHasExtFSVol);
  1321.     END;
  1322.  
  1323.     FUNCTION hasOpenDeny (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  1324.     BEGIN
  1325.         hasOpenDeny := BTST(volParms.vMAttrib, bHasOpenDeny);
  1326.     END;
  1327.  
  1328.     FUNCTION hasCopyFile (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  1329.     BEGIN
  1330.         hasCopyFile := BTST(volParms.vMAttrib, bHasCopyFile);
  1331.     END;
  1332.  
  1333.     FUNCTION hasMoveRename (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  1334.     BEGIN
  1335.         hasMoveRename := BTST(volParms.vMAttrib, bHasMoveRename);
  1336.     END;
  1337.  
  1338.     FUNCTION hasDesktopMgr (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  1339.     BEGIN
  1340.         hasDesktopMgr := BTST(volParms.vMAttrib, bHasDesktopMgr);
  1341.     END;
  1342.  
  1343.     FUNCTION hasShortName (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  1344.     BEGIN
  1345.         hasShortName := BTST(volParms.vMAttrib, bHasShortName);
  1346.     END;
  1347.  
  1348.     FUNCTION hasFolderLock (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  1349.     BEGIN
  1350.         hasFolderLock := BTST(volParms.vMAttrib, bHasFolderLock);
  1351.     END;
  1352.  
  1353.     FUNCTION hasPersonalAccessPrivileges (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  1354.     BEGIN
  1355.         hasPersonalAccessPrivileges := BTST(volParms.vMAttrib, bHasPersonalAccessPrivileges);
  1356.     END;
  1357.  
  1358.     FUNCTION hasUserGroupList (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  1359.     BEGIN
  1360.         hasUserGroupList := BTST(volParms.vMAttrib, bHasUserGroupList);
  1361.     END;
  1362.  
  1363.     FUNCTION hasCatSearch (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  1364.     BEGIN
  1365.         hasCatSearch := BTST(volParms.vMAttrib, bHasCatSearch);
  1366.     END;
  1367.  
  1368.     FUNCTION hasFileIDs (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  1369.     BEGIN
  1370.         hasFileIDs := BTST(volParms.vMAttrib, bHasFileIDs);
  1371.     END;
  1372.  
  1373.     FUNCTION hasBTreeMgr (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  1374.     BEGIN
  1375.         hasBTreeMgr := BTST(volParms.vMAttrib, bHasBTreeMgr);
  1376.     END;
  1377.  
  1378.     FUNCTION hasBlankAccessPrivileges (VAR volParms: GetVolParmsInfoBuffer): Boolean;
  1379.     BEGIN
  1380.         hasBlankAccessPrivileges := BTST(volParms.vMAttrib, bHasBlankAccessPrivileges);
  1381.     END;
  1382.  
  1383. END.